<?php
$page_title="Manage News & Events - List";
	include("includes/header.php");
?>
<?
$query="select * from bkit_news where rec_status>=1 ";
$newsInfo = qry_data($query." order by news_id desc");
$news_status=Array("1"=>"Yes","2"=>"No");
$news_type=Array("0"=>"News","1"=>"Event");
?>
	<div class="fleft">
		<ul class="subMenu">
		<li><a href="edit_news.php?mode=add" >Add New </a></li>
		<li style="border:0px solid;width:130px;"><a href="event_reg_list.php" >Event Registrations </a></li>
		</ul>
		</div>		
		<div class="cleardiv">
		
		</div>
<table width="100%" >
	<tr>
	<td valign="top">
		
	<table   class="table_panel" width="100%"  cellspacing="0" cellpadding="4">
	<tr  align="left">
	<th width="5">S.No</th>

	<th style="width:120px">Title</th>
	<th>Type</th>
	<th >Content </th>
	<th>Date</th>
	<th>Posted on</th>

	
	<th>Is Visible</th>

	<th >Last Updated</th>
	<th >Registrants</th>
	<th >Edit/Delete</th>
	</tr>
	<? foreach($newsInfo as $i=>$news) {?>

	<tr <?if($i%2==0) echo 'class="white_bg"'; else echo 'class="grey_bg"' ?>>
	<td><?=$i+1;?></td>
	
	<td ><?=$news["news_title"];?></td>
	<td><?=$news_type[(int)$news["news_type"]];?></td>
	<td><?=substr(strip_tags($news["news_content"]),0,20);?></td>
	<td><?=$news["news_date"];?></td>
	
	<td><?=$news["posted_date"];?></td>
	<td><?=$news_status[(int)$news["rec_status"]];?></td>

	<td><?=$news["last_updated"]?></td>
	<td>
		<?if($news["news_type"]==1){?>
		<a href="event_reg_list.php?event_id=<?=$news["news_id"]?>">
			View Registrations</a>
			<? } ?>

	</td>
	<td>
		<a href="edit_news.php?mode=edit&news_id=<?=$news["news_id"];?>">Edit</a> | 
		<a  href="javascript:if(confirm('Are you sure to delete this News / Event?')) location.href='edit_news.php?mode=del&news_id=<?=$news["news_id"];?>'";>Delete</a> 
	</td>
	</tr>
	
	<? } ?>
	</table>
	
	</td>
	</tr>
	
	</table>

<?php include("includes/footer.php"); ?>



